export const tradersCol = [
  //交易员信息
  {
    dataIndex: 'traderCode',
    key: 'traderCode',
    title: '交易员代码',
  },
  {
    dataIndex: 'traderName',
    key: 'traderName',
    title: '交易员名称',
  },
];
export const rateCol = [
  //评级信息
  {
    dataIndex: 'ratingAgency',
    key: 'ratingAgency',
    title: '评级机构',
  },
  {
    dataIndex: 'rating',
    key: 'rating',
    title: '评级',
  },
  {
    dataIndex: 'ratingType',
    key: 'ratingType',
    title: '评级类型',
  },
  {
    dataIndex: 'ratingDate',
    key: 'ratingDate',
    title: '评级日期',
  },
];
export const controllingShareholderCol = [
  //控股股东信息
  {
    dataIndex: 'nameOfShareholder',
    key: 'nameOfShareholder',
    title: '控股股东名称',
  },
  {
    dataIndex: 'certificateType',
    key: 'certificateType',
    title: '控股股东证件类型',
  },
  {
    dataIndex: 'identificationNumber',
    key: 'identificationNumber',
    title: '控股股东证件号码',
  },
  {
    dataIndex: 'shareholdingRatio',
    key: 'shareholdingRatio',
    title: '控股股东持股比例(%)',
  },
  {
    dataIndex: 'effectiveDate',
    key: 'effectiveDate',
    title: '有效期起始日',
  },
  {
    dataIndex: 'expiryDate',
    key: 'expiryDate',
    title: '有效期截止日',
  },
];
export const otherShareholderCol = [
  //其他股东信息
  {
    dataIndex: 'nameOfShareholder',
    key: 'nameOfShareholder',
    title: '其他股东名称',
  },
  {
    dataIndex: 'certificateType',
    key: 'certificateType',
    title: '其他股东证件类型',
  },
  {
    dataIndex: 'identificationNumber',
    key: 'identificationNumber',
    title: '其他股东证件号码',
  },
  {
    dataIndex: 'shareholdingRatio',
    key: 'shareholdingRatio',
    title: '其他股东持股比例(%)',
  },
  {
    dataIndex: 'effectiveDate',
    key: 'effectiveDate',
    title: '有效期起始日',
  },
  {
    dataIndex: 'expiryDate',
    key: 'expiryDate',
    title: '有效期截止日',
  },
];
export const beneficiaryCol = [
  //收益人信息
  {
    dataIndex: 'nameOfShareholder',
    key: 'nameOfShareholder',
    title: '受益所有人名称',
  },
  {
    dataIndex: 'certificateType',
    key: 'certificateType',
    title: '受益人证件类型',
  },
  {
    dataIndex: 'identificationNumber',
    key: 'identificationNumber',
    title: '受益人证件号码',
  },
  {
    dataIndex: 'address',
    key: 'address',
    title: '受益人地址',
  },
  {
    dataIndex: 'effectiveDate',
    key: 'effectiveDate',
    title: '有效期起始日',
  },
  {
    dataIndex: 'expiryDate',
    key: 'expiryDate',
    title: '有效期截止日',
  },
];
export const representativeCol = [
  //法定代表人信息
  {
    dataIndex: 'nameOfShareholder',
    key: 'nameOfShareholder',
    title: '法定代表人名称',
  },
  {
    dataIndex: 'certificateType',
    key: 'certificateType',
    title: '法定代表人证件类型',
  },
  {
    dataIndex: 'identificationNumber',
    key: 'identificationNumber',
    title: '法定代表人证件号码',
  },
  {
    dataIndex: 'effectiveDate',
    key: 'effectiveDate',
    title: '有效期起始日',
  },
  {
    dataIndex: 'expiryDate',
    key: 'expiryDate',
    title: '有效期截止日',
  },
];
export const rateOrganList = [
  //评级机构
  { id: 0, name: '内部' },
  { id: 1, name: '标普' },
  { id: 2, name: '惠誉' },
  { id: 3, name: '穆迪' },
  { id: 4, name: '中诚信国际' },
  { id: 5, name: '中诚信证券评估' },
  { id: 6, name: '大公' },
  { id: 7, name: '东方今诚' },
  { id: 8, name: '联合评级' },
  { id: 9, name: '鹏元资信' },
  { id: 10, name: '新世纪' },
  { id: 11, name: '远东宏信' },
];
export const rateType = [
  //评级类型
  { id: 0, name: '长期信用评级' },
  { id: 1, name: '短期信用评级' },
];
export const certificateType = [
  //证件类型
  { id: 0, name: '身份证' },
  { id: 1, name: '社会统一信用代码' },
];
export const titleObj = {
  //模态框title
  traders: '对手交易员信息',
  rate: '交易对手评级',
  controllingShareholder: '控股股东信息',
  otherShareholder: '其他股东信息',
  beneficiary: '实际受益人信息',
  representative: '法定代表人信息',
};
//id转换对应的name
export const renderChinese = (id, data) => {
  let name = '';

  const arr = data || [];
  arr.map((item) => {
    if (item.code && item.code == id) {
      name = item.value;
    }
    if (item.value && item.value == id) {
      name = item.title;
    }
  });
  return name || '--';
};
